const path = require("path");
const { exec } = require("child_process");

const prjPath = process.cwd();
const packageJSON = require(path.join(prjPath, "package.json"));
const name = packageJSON.name;
const version = packageJSON.deploy.version;
const zipDir = path.join(prjPath, "dist", name, version);

exec('zip -q -r ' + name + '.zip *', {
    cwd: zipDir
}, (err, stdout, stderr) => {
  if (stderr) {
    console.error(`error: ${stderr}`);
  }
  console.log(`${stdout}`)
})
